package org.lift.gui;

import java.awt.EventQueue;

import javax.swing.JFrame;
import java.awt.FlowLayout;
import javax.swing.JButton;

import org.lift.Lift;

import java.awt.Dimension;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class GUIApp {
	
	Lift unserLift = new Lift();

	private JFrame frame;
	private JButton btnstock;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					GUIApp window = new GUIApp();
					window.frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
		
		
	}

	/**
	 * Create the application.
	 */
	public GUIApp() {
		initialize();
	}

	/**
	 * Initialize the contents of the frame.
	 */
	private void initialize() {
		frame = new JFrame();
		frame.setBounds(100, 100, 450, 300);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.getContentPane().setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));

		btnstock = new JButton("1");
		btnstock.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
			}
		});

		JButton btnOg = new JButton("2");
		btnOg.setPreferredSize(new Dimension(77, 23));
		btnOg.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
			}
		});
		frame.getContentPane().add(btnOg);
		btnstock.setPreferredSize(new Dimension(77, 23));
		frame.getContentPane().add(btnstock);

		JButton btnEg = new JButton("EG");
		btnEg.setPreferredSize(new Dimension(77, 23));
		frame.getContentPane().add(btnEg);

		JButton btnUg = new JButton("-1");
		btnUg.setPreferredSize(new Dimension(77, 23));
		frame.getContentPane().add(btnUg);

		JButton btnUg_1 = new JButton("-2");
		btnUg_1.setPreferredSize(new Dimension(77, 23));
		frame.getContentPane().add(btnUg_1);

		ActionListener listener1 = new ActionListener() {
			@Override public void actionPerformed(ActionEvent e) {
			unserLift.zielEingeben(0);
			
			}
		};
		
		btnEg.addActionListener(listener1);
		
		ActionListener listener2 = new ActionListener() {
			@Override public void actionPerformed(ActionEvent e) {
			unserLift.zielEingeben(-1);
			
			}
		};
	
		btnUg.addActionListener(listener2);
		
		ActionListener listener3 = new ActionListener() {
			@Override public void actionPerformed(ActionEvent e) {
			unserLift.zielEingeben(-2);
			
			}
		};
		
		btnUg_1.addActionListener(listener3);
		
		ActionListener listener4 = new ActionListener() {
			@Override public void actionPerformed(ActionEvent e) {
			unserLift.zielEingeben(2);
			
			}
		};
		
		btnOg.addActionListener(listener4);
		
		ActionListener listener5 = new ActionListener() {
			@Override public void actionPerformed(ActionEvent e) {
			unserLift.zielEingeben(1);
			
			}
		};
		
		btnstock.addActionListener(listener5);
}

}